{include file="default/base/header" /} 
<style>
body{
   background: #FFF;
}
.submit{
    color: #FFF;
    background-color: #3480c1;
    display: block;
    font: 12px/30px "microsoft yahei";
    width: 64px;
    height: 30px;
    padding: 0;
    cursor: pointer;
    border: 0;
    border-radius: 2px
}
</style>


<link rel="stylesheet" href="{$Think.PLUGINS_SITE_ROOT}/js/jquery.lightbox/css/lightbox.min.css">
<script src="{$Think.PLUGINS_SITE_ROOT}/js/jquery.lightbox/js/lightbox.min.js"></script>
<div class='page'>
  <form action="{:url('Sellerorder/split_order')}" method="post" id='goods_form'>
      <table border="0" cellpadding="0" cellspacing="0" class="ds-default-table">
       <thead>
           <tr>
               <th colspan="6">订单信息</th>
           </tr>
       </thead>
       <tbody>
        <input type="hidden" name="order_id" value="{$order_id}" >
           <tr>
               <th style='width: 550px;'>商品名称</th>
               <th>数量</th>
               <th>拆分数量</th>
           </tr> 
           {if isset($order_goods)&&!empty($order_goods)}
           {volist name='order_goods' id='vo' }
            <tr>
               <td>{$vo.goods_name}</td>
               <td>{$vo.goods_num}</td>
               <td><input type="hidden" name="goods_num[{$vo.rec_id}]" value="{$vo.goods_num}" ><input type="text" name="goods_nums[{$vo.rec_id}]" value='0' ></td>
           </tr> 
           {/volist}
           {/if} 
       </tbody>
       <tr>
               <td><input type="submit" class='submit'  value="提交"></td>
            
           </tr> 
   </table>
   </form>
</div>

<script>
$(document).ready(function(){
  $('form').submit(function(){
      var url = $('form').attr('action');
        $.ajax({
          type: "POST",
            url:url,
             data:$('#goods_form').serialize(),// 你的formid
         error: function(request) {
                  alert("Connection error");
                    },
         success: function(data) {
          //alert(data);return false;
            if(data.code==0){
                 layer.msg(data.msg);return false;
               }else if(data.code==-1){
              parent.layer.msg(data.msg);
              setTimeout(()=>{
                parent.layer.closeAll();
             parent.location.href=data.url;
              },1000)
             }else{
               parent.layer.msg(data.msg);
               
              setTimeout(()=>{
                parent.layer.closeAll();
             parent.location.href=data.url;
              },1000)
              
              
                       }
                  }
                        });return false;



  });
});




</script>
